/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ucb.ProjetoFinal.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author DCBorges
 */
@Entity
@Table(name = "sdctb008_stco_cdsl")
public class SituacaoCadastrall implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "CO_SITUACAO_CDSTL")
    private Character coSituacaoCdstl;
    @Size(max = 50)
    @Column(name = "NO_SITUACAO_CDSTL")
    private String noSituacaoCdstl;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "coSituacaoGrupo")
    private List<GrupoFamiliar> grupoFamiliarList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "coSituacaoCdstl")
    private List<PesquisaCadastral> pesquisaCadastralList;

    public SituacaoCadastrall() {
    }

    public SituacaoCadastrall(Character coSituacaoCdstl) {
        this.coSituacaoCdstl = coSituacaoCdstl;
    }

    public Character getCoSituacaoCdstl() {
        return coSituacaoCdstl;
    }

    public void setCoSituacaoCdstl(Character coSituacaoCdstl) {
        this.coSituacaoCdstl = coSituacaoCdstl;
    }

    public String getNoSituacaoCdstl() {
        return noSituacaoCdstl;
    }

    public void setNoSituacaoCdstl(String noSituacaoCdstl) {
        this.noSituacaoCdstl = noSituacaoCdstl;
    }

    public List<GrupoFamiliar> getGrupoFamiliarList() {
        return grupoFamiliarList;
    }

    public void setGrupoFamiliarList(List<GrupoFamiliar> grupoFamiliarList) {
        this.grupoFamiliarList = grupoFamiliarList;
    }

    public List<PesquisaCadastral> getPesquisaCadastralList() {
        return pesquisaCadastralList;
    }

    public void setPesquisaCadastralList(List<PesquisaCadastral> pesquisaCadastralList) {
        this.pesquisaCadastralList = pesquisaCadastralList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (coSituacaoCdstl != null ? coSituacaoCdstl.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SituacaoCadastrall)) {
            return false;
        }
        SituacaoCadastrall other = (SituacaoCadastrall) object;
        if ((this.coSituacaoCdstl == null && other.coSituacaoCdstl != null) || (this.coSituacaoCdstl != null && !this.coSituacaoCdstl.equals(other.coSituacaoCdstl))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.ucb.ProjetoFinal.domain.SituacaoCadastrall[ coSituacaoCdstl=" + coSituacaoCdstl + " ]";
    }
    
}
